package com.xialinrui.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xialinrui.dto.DailyMoneyDto;
import com.xialinrui.vo.ExpenditureCategoryVo;
import com.xialinrui.vo.IncomeCategoryVo;
import com.xialinrui.dto.MonthlyMoneyDto;
import com.xialinrui.entity.Replay;
import com.xialinrui.mapper.ReplayMapper;
import com.xialinrui.service.ReplayService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author xialinrui
 */
@Service
public class ReplayServiceImpl extends ServiceImpl<ReplayMapper, Replay> implements ReplayService {

    @Resource
    private ReplayMapper replayMapper;

    @Override
    public void addOneInstant(Replay replay) {
        replayMapper.insert(replay);
    }

    @Override
    public void delete(List<Long> ids) {
        replayMapper.deleteBatchIds(ids);
    }

    @Override
    public List<DailyMoneyDto> moneyDailyIncome(String from, String to) {
        return replayMapper.moneyDailyIncome(from, to);
    }

    @Override
    public List<DailyMoneyDto> moneyDailyExpenditure(String from, String to) {
        return replayMapper.moneyDailyExpenditure(from, to);
    }

    @Override
    public List<MonthlyMoneyDto> moneyMonthlyIncome(String from, String to) {
        return replayMapper.moneyMonthlyIncome(from, to);
    }

    @Override
    public List<MonthlyMoneyDto> moneyMonthlyExpenditure(String from, String to) {
        return replayMapper.moneyMonthlyExpenditure(from, to);
    }

    @Override
    public List<MonthlyMoneyDto> moneyYearlyIncome(String from, String to) {
        return replayMapper.moneyYearlyIncome(from, to);
    }

    @Override
    public List<MonthlyMoneyDto> moneyYearlyExpenditure(String from, String to) {
        return replayMapper.moneyYearlyExpenditure(from, to);
    }

    @Override
    public List<IncomeCategoryVo> getIncomeMoneyByCategory(String from, String to) {
        return replayMapper.incomeByCategory(from, to);
    }

    @Override
    public List<ExpenditureCategoryVo> getExpenditureMoneyByCategory(String from, String to) {
        return replayMapper.expenditureByCategory(from, to);
    }
}
